import { request } from "umi";

/** 获取数据列表 GET /api/dataItem/list */
export async function list(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  sorter?:any,
  filter?: any,
  options?: { [key: string]: any }
) {
  return request<API.DataItemList>("/api/dataItem/list", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 新建 POST /api/dataItem/edit */
export async function update(options?: { [key: string]: any }) {
  return request<API.APIResult>("/api/dataItem/edit", {
    method: "POST",
    ...(options || {}),
  });
}

/** 删除 POST /api/dataItem/delete */
export async function remove(options?: { [key: string]: any }) {
  return request<API.APIResult>("/api/dataItem/delete", {
    method: "POST",
    ...(options || {}),
  });
}
